<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
	<%@page import="model.UserModel" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>FlowerStoreAdmin</title>
<link rel="stylesheet" href="css/bootstrap.min.css" />
<link rel="stylesheet" href="css/bootstrap-responsive.min.css" />
<link rel="stylesheet" href="css/login.css" />
</head>
<%
	String alert = (String) session.getAttribute("alert");
	UserModel user = (UserModel) session.getAttribute("user_session");
	if(user != null){
		response.sendRedirect("./");
	}
%>
<body>
	<div class="container">
		<div id="aero">
			<div id="aero1">
				<div id="content" class="row">
					<div id="head_line">
						<h1>HỆ THỐNG QUẢN LÝ FLOWERSTORE</h1>
					</div>
					<div id="content_left" class="span4">
						<table>
							<tr>
								<td colspan="2">
									<%
										if (alert != null) {
											out.println(alert);
											session.removeAttribute("alert");
										}
									%>
								</td>
							</tr>
							<tr>
								<td colspan="2"><h5>ĐĂNG NHẬP</h5></td>
							</tr>
							<form action="Login">
								<tr>
									<td><label>Tên tài khoản: </label></td>
									<td><input type="text" name="un"
										placeholder="Tài khoản" /></td>
								</tr>
							<tr>
								<td><label>Mật khẩu: </label></td>
								<td><input type="password" name="upd"
									placeholder="Mật khẩu" /></td>
							</tr>
							<tr>
								<td><i class="icon-question-sign"></i></td>
								<td><a href="#Forgot" id="forgot_link">Quên mật khẩu?</a></td>
							</tr>
							<tr>
								<td></td>
								<td><input type="submit" value="Đăng nhập"
									class="btn btn btn-info" /></td>
							</tr>
							</form>
						</table>
					</div>
					<div id="content_right" class="span3">
						<div id="lock">
							<img src="img/lock.png" />
						</div>
						<div id="forgot">
							<span id="close_forgot_form"><i class="icon-remove-circle"
								alt="Đóng" title="Đóng"></i></span> <img src="img/lost_password.png" />
							<h5>KHÔI PHỤC TÀI KHOẢN</h5>
							<div class="input-append">
								<input type="text" id="email"
									placeholder="Email của bạn!" /> <input
									type="submit" value="Gửi" class="btn btn btn-info" id="send" />
								</form>
							</div>
							<span id="loading"><img src="img/ajax-loader.gif" /></span>
							<div id="alert_message"></div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</body>
<script type="text/javascript" src="js/jquery-1.9.1.min.js"></script>
<script type="text/javascript" src="js/bootstrap.min.js"></script>
<script type="text/javascript">
	$(document).ready(function() {
		$("#forgot").hide();
		$("#loading").hide();
		$("#forgot_link").click(function() {
			$("#lock").hide("slow");
			$("#forgot").show("slow");
		});
		$("#close_forgot_form").click(function() {
			$("#lock").show("slow");
			$("#forgot").hide("slow");
		});
		$("#send").click(function() {
			$("#loading").show("slow");
		}, function() {
			$.ajax({
				type : 'POST',
				url : 'restore_password.jsp', //goi toi file ajax.php
				data : 'email=' + $("#email").val(),//du lieu gui di
				//cache: false,
				success : function(html) {
					$("#alert_message").html(html);
					$("#loading").hide("slow");
				}
			});
		});
	});
</script>
</html>